#include "mainwindow.h"
#include "logindialog.h"
#include "databasemanager.h"
#include <QMessageBox>

#include <QApplication>

int main(int argc, char *argv[])
{
    QApplication a(argc, argv);

    //初始化数据库
    if(!DatabaseManager::instance().connectToDatabase()){
        QMessageBox::critical(nullptr,"错误","无法连接到数据库");
        return 1;
    }

    loginDialog logindialog;
    if(logindialog.exec()==QDialog::Accepted){
    MainWindow w;
    w.show();
    return a.exec();
    }
}
